How to delete duplicate records from a table.





Copy the structure of the table, assign a primary key in the new table for the field containing duplicate information, create an append query from the original table to the newly created table.

    1) If the Database window is not active, activate the Database window.
    2) Choose the 'Table' tab in the Database window.
    < Tables tab >
    3) Select the table containing duplicate records.
    4) Select the 'Edit' menu and select 'Copy'.
    5) Select the 'Edit' menu and select 'Paste'. (The Paste Table As dialog box appears.)
    6) Enter the name for the new table in the 'Table Name' box.
    7) Select the 'Structure Only' button.
    8) Choose 'OK'. (The newly created table appears in the Database window.)
    9) Select the newly created table.
    10) Choose the 'Design' button. (The new table appears.)
    11) Select the field containing duplicate data.
    12) Select the 'Edit' menu and select 'Primary Key'. (The selected field has a key symbol to the left of the field name.)
    13) Select the 'File' menu and select 'Save' to save the table.
    14) Select the 'File' menu and select 'Close' to close the table.
    15) To create the append query, do the following:

      a) Choose the 'Queries' tab in the Database window.
      < Queries tab >
      b) Choose the 'New' button. (The New Query dialog box appears.)
      c) Select 'Design View' in the 'New Query' list box.
      d) Choose 'OK'. (The Show Table dialog box appears.)
      e) Choose the 'Tables' tab.
      f) Select the original table name in the list box.
      g) Choose the 'Add' button. (The selected table appears in the query design view behind the dialog box.)
      h) Choose the 'Close' button.
      i) Select the 'Query' menu and select 'Append'. (The Append dialog box appears.)
      j) Click on the down arrow in the 'Table Name' drop-down list.
      k) Select the newly developed table name.
      l) Choose 'OK'. (The query design view appears.)
      m) Click in the 'Field' cell of the first column. (A down arrow appears.)
      n) Choose the down arrow. (A drop-down list appears.)
      o) Select the table name with the asterisk (*).
      p) Select the 'Query' menu and select 'Run'. (A message box appears.)
      q) Choose 'Yes' to proceed with the query.
      r) Choose 'Yes' again.
      NOTE: The query remains in Design view on the screen. The second table already contains the correct data.

    16) Select the 'File' menu and select 'Close' to close the Append query.


Knowledge-Pak Desktop Suite (TM) Edition 5
Copyright (c) 1994-1997 by ServiceWare Inc. Subject to the terms set forth in the end-user license agreement. All rights reserved.



2nd Opinion copyright © 1997 by McAfee Associates.
Subject to the terms set forth in the end-user license agreement. All rights reserved.